package com.ruoyi.car.business.query;


import com.ruoyi.common.core.page.PageDomain;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Calendar;
import java.util.Date;

@Getter
@Setter
public class BusCustomerQuery extends PageDomain {
    // 按照名字模糊查询
    private String name;
    // 按照是否vip查询
    private Integer vip;
    // 按照时间范围查询
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date maxDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date minDate;
    // 排除被软删除数据
    private Integer isDelete = 0;

    public Date getEndTime() {
        if (minDate != null) {
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(minDate);
            calendar.add(Calendar.DAY_OF_WEEK,1);
            return calendar.getTime();
        }
        return null;
    }
}
